import {pget, postFileByFormData, ppostJson} from '@/utils/req'
import {modalApi} from '@/utils/modalReq'

// 保险列表
export function getAssertsCarInsurancebaseList(query: any) {
	return pget(`${modalApi.carMessage}/assertsCarInsurancebase/page`, query)
}

// 保险编辑
export function editInsurance(data: any) {
	return ppostJson(
		`${modalApi.carMessage}/assertsCarInsurancebase/update`,
		data,
	)
}

// 保险详情
export function viewInsurance(query: any) {
	return pget(`${modalApi.carMessage}/assertsCarInsurancebase/detail`, query)
}

// 购买记录
export function histryList(query: any) {
	return pget(`${modalApi.carMessage}/assertsbuyinsurance/page`, query)
}

// 批量上传保单
export function uploadInsurancePhoto(data: any) {
	return ppostJson(
		`${modalApi.carMessage}/assertsCarInsurancebase/uploadInsurancePhoto`,
		data,
	)
}

/** 获取导入失败列表 */
export function getInsurancePage(query?: any) {
	return pget(
		`${modalApi.carMessage}/assetsaccidentdataprocessing/insurancePage`,
		query,
	)
}
/** 停延保获取错误数据 */
export function getSuspensionPage(query?: any) {
	return pget(
		`${modalApi.carMessage}/assetsaccidentdataprocessing/suspensionPage`,
		query,
	)
}
/** 复始获取错误数据 */
export function getStartOverPage(query?: any) {
	return pget(
		`${modalApi.carMessage}/assetsaccidentdataprocessing/startOverPage`,
		query,
	)
}

/** 保存保险导入数据 */
export function applycostImport(query?: any) {
	return ppostJson(
		`${modalApi.carMessage}/assertsCarInsurancebase/importInsurance${query.batch}`,
	)
}
/** 保险导入 */
export function insuranceImport(query?: any) {
	return postFileByFormData(
		`${modalApi.carMessage}/assertsCarInsurancebase/importInsurance`,
		query,
	)
}
/** 停延保导入 */
export function importSuspensionInsurance(query?: any) {
	return postFileByFormData(
		`${modalApi.carMessage}/assertsCarInsurancebase/importSuspensionInsurance`,
		query,
	)
}
/** 复始导入 */
export function importStartOverInsurance(query?: any) {
	return postFileByFormData(
		`${modalApi.carMessage}/assertsCarInsurancebase/importStartOverInsurance`,
		query,
	)
}
